<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/11/21
 * Time: 23:14
 */
namespace phpfuntions\mp_datetime;
class myphp_datetime
{

    /**
     *checkdate 函数：验证一个格里高里日期
     * @access public
     * @return
     */
    public static function checkdate ($month, $day, $year) {
        return checkdate( $month, $day, $year);

    }

    /**
     *date_default_timezone_get 函数：获取一个脚本中所有日期、时间 函数所使用的默认时区　
     * @access public
     * @return
     */
    public static function date_default_timezone_get () {
        return date_default_timezone_get( );

    }

    /**
     *date_default_timezone_set 函数：设定用于一个脚本中所有日期、时间 函数的默认时区
     * @access public
     * @return
     */
    public static function date_default_timezone_set ($timezone_identifier) {
        return date_default_timezone_set( $timezone_identifier);

    }

    /**
     *date_sunrise 函数：返回给定的日期与地点的日出时间　
     * @access public
     * @return
     */
    public static function date_sunrise ($timestamp, $format = null, $latitude = null, $longitude = null, $zenith = null, $gmt_offset = null) {
        return date_sunrise( $timestamp, $format, $latitude, $longitude , $zenith , $gmt_offset );

    }

    /**
     *date_sunset 函数：返回给定的日期与地点的日落时间　
     * @access public
     * @return
     */
    public static function date_sunset ($timestamp, $format = null, $latitude = null, $longitude = null, $zenith = null, $gmt_offset = null) {
        return date_sunset( $timestamp, $format , $latitude  , $longitude , $zenith , $gmt_offset );

    }

    /**
     *date 函数：格式化一个本地时间/日期　
     * @access public
     * @return
     */
    public static function date ($format, $timestamp = 'time()') {
        return date($format, $timestamp );

    }

    /**
     *getdate 函数：获取日期/时间信息
     * @access public
     * @return
     */
    public static function getdate ($timestamp = null) {
        return getdate( $timestamp );

    }

    /**
     *gettimeofday 函数：获取当前时间　
     * @access public
     * @return
     */
    public static function gettimeofday ($return_float = null) {
        return gettimeofday( $return_float );

    }

    /**
     *gmdate 函数：格式化一个GMT/UTC日期/时间　
     * @access public
     * @return
     */
    public static function gmdate ($format, $timestamp = null) {
        return gmdate( $format, $timestamp );

    }

    /**
     *gmmktime 函数：获取GMT日期的UNIX时间戳　
     * @access public
     * @return
     */
    public static function gmmktime ($hour = null, $minute = null, $second = null, $month = null, $day = null, $year = null, $is_dst = null) {
        return gmmktime( $hour , $minute , $second , $month , $day , $year, $is_dst );

    }

    /**
     *gmstrftime 函数：根据区域设置格式化GMT/UTC时间/日期
     * @access public
     * @return
     */
    public static function gmstrftime ($format, $timestamp = null) {
        return gmstrftime($format, $timestamp   );

    }

    /**
     *idate 函数：将本地时间、日期格式化为整数
     * @access public
     * @return
     */
    public static function idate ($format, $timestamp = null) {
        return idate( $format, $timestamp);

    }

    /**
     *localtime 函数：获取本地时间
     * @access public
     * @return
     */
    public static function localtime ($timestamp = null, $is_associative = null) {
        return localtime( $timestamp , $is_associative  );

    }

    /**
     *microtime 函数：返回当前UNIX时间戳和微秒数
     * @access public
     * @return
     */
    public static function microtime ($get_as_float = null) {
        return microtime( $get_as_float );

    }

    /**
     *mktime 函数：获取一个日期的UNIX时间戳　
     * @access public
     * @return
     */
    public static function mktime ($hour = null, $minute = null, $second = null, $month = null, $day = null, $year = null, $is_dst = -1) {
        return mktime($hour, $minute , $second , $month , $day, $year , $is_dst);

    }

    /**
     *strftime 函数：根据区域设置格式化本地时间/日期　
     * @access public
     * @return
     */
    public static function strftime ($format, $timestamp) {
        return strftime( $format, $timestamp);

    }

    /**
     *strptime 函数：解析由strftime生成的日期/时间
     * @access public
     * @return
     */
    public static function strptime ($date, $format) {
        return strptime($date, $format );

    }

    /**
     *strtotime 函数：将任何英文文本的日期、时间描述解析为UNIX时间戳
     * @access public
     * @return
     */
    public static function strtotime ($time, $now) {
        return strtotime($time, $now );

    }

    /**
     *time 函数：返回当前的UNIX时间戳　
     * @access public
     * @return
     */
    public static function time () {
        return time( );

    }
}